@using Dyn.News.Extensions;
@using Dyn.News.Models;
@using Orchard.Core.Contents.ViewModels;
@using Orchard.Utility.Extensions;
@{  Style.Require("Admin");
    Layout.Title = T("Manage Categories").ToString(); }
@if (Model.ContentItems.Items.Count > 0)
{ 
    <div class="manage">
        <a class="add button primaryAction" href="@Url.CategoryCreate()">@T("New Category")</a></div>
    using (Html.BeginFormAntiForgeryPost(Url.Action("SubList", "CategoryAdmin", new { area = "Dyn.News", id = "" })))
    {
      <div class="bulk-actions" style="float:left">
        <label for="filterResults">@T("Filters:")</label>
        <select id="filterResult" name="select">
            @Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.None, T("Choose filter...").ToString())
         
            @foreach (NewsCategoryPart i in ViewBag.CategoryParents)
            {
                @Html.SelectOption(i.Id, false, i.Name.ToString())
            }</select>
        <button type="submit" name="filter" value="yes">@T("Apply")</button>
       </div>
    }
    using (Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" })))
    {
    <div class="bulk-actions" style="float:left">
        <label for="publishActions">@T("Actions:")</label>
        <select id="publishActions" name="Options.BulkAction">
            @Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.None, T("Choose action...").ToString())
            @Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.Remove, T("Delete").ToString())
        </select>
        @Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString())
        <button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
    </div>
      
    <fieldset class="contentItems bulk-items">
        @Display(Model.ContentItems)
    </fieldset>
    }

}
else
{
    <div class="info message">@T("There are no categories for you to see. Want to <a href=\"{0}\">add one</a>?", Url.CategoryCreate())</div>
}